package com.ftg.learn.springboot.video.controller;

import com.ftg.learn.springboot.video.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("video")
@RestController
@CrossOrigin
public class VideoController {

	@Autowired
	VideoService vs;

	@GetMapping("/findVideo")
	public Map<String,Object> findVideo(){

		Map<String,Object> map = new HashMap<>();
		map.put("data",vs.findVideo());
		return map;

	}

}
